package com.qlylkj.lbk.model.repository

import com.qlylkj.lbk.model.api.AuthApi
import com.qlylkj.lbk.model.api.BaseRepository
import com.qlylkj.lbk.model.api.ResultResponse
import com.qlylkj.lbk.model.api.RetrofitHelper

class AuthRepository: BaseRepository() {

    private val authApi by lazy { RetrofitHelper.getService(AuthApi::class.java) }

    suspend fun identityAuth(options: MutableMap<String, Any>): ResultResponse<Any>{
        return safeApiCallEntity(
            call = { requestIdentityAuth(options) },
            errorMessage = "身份认证失败"
        )
    }

    private suspend fun requestIdentityAuth(options: MutableMap<String, Any>): ResultResponse<Any>{
        val response = authApi.identityAuth(requestJsonBody(options))
        return executeEntityResponse(response, {

        })
    }

}